package com.pearl.boot.rabbitmq;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

/**
 * @author TangDan
 * @version 1.0
 * @since 2022/11/29
 */

@Component
public class RabbitHandlerConsumer {

    @RabbitHandler(isDefault = true)
    public void receive001(byte[] message) {
        System.out.println("receive001收到消息" + new String(message));
    }

    @RabbitHandler
    public void receive002(String message) {
        System.out.println("receive002收到消息" + message);
    }

    @RabbitListener(queues = {"dsfsf"})
    public void receive003(User message) {
        System.out.println("receive003收到消息" + message);
    }
}
